import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;


public class LinkedListTest1 {
		
	public LinkedList ll = new LinkedList();
	public Node test;

	@Test
	public void testInsert() {
		Assert.assertNull(ll.start);
		ll.insert(1);
		Assert.assertNotNull(ll.start);
		Assert.assertTrue(1 == ll.start.data);
		ll.insert(2);
		test = ll.start.getNext();
		Assert.assertTrue(1 == ll.start.data);
		Assert.assertTrue(2 == test.data);
	}

	@Test
	public void testDelete() {
		Assert.assertNull(ll.start);
		ll.insert(1);
		Assert.assertNotNull(ll.start);
		Assert.assertTrue(1 == ll.start.data);
		ll.delete(1);
		Assert.assertNull(ll.start);
		ll.insert(2);
		ll.insert(3);
		test = ll.start.getNext();
		Assert.assertTrue(2 == ll.start.data);
		Assert.assertTrue(3 == test.data);
		ll.delete(2);
		Assert.assertTrue(3 == ll.start.data);
		test = ll.start.getNext();
		Assert.assertNull(test);
		ll.delete(3);
		Assert.assertNull(ll.start);
	}

}
